/**
 * 退回意见 - 编辑页面
 * @author miaoyl
 * @date 2019/04/22
 */
define(function () {

    var self,
        app = win.app,
        doc = document,
        vueData = {
            form: {
                GWAK088: null
            },
            rules: {
                GWAK088: [
                    {required: true, message: '不可为空', trigger: 'blur'}
                ]
            }
        },
        callObj
    ;

    var Gwak088Edit = app.Module.extend({
        init: function () {
            self = this;
            self._super({
                _tag: 'gwai300_edit_gwak088',
            }, win);
        },

        updateData: function () {
            app.ajax({
                xurl: 'crm/gwai300/updateBackInfo',
                xdata: {_xdata: callObj._xdata, GWAK088: vueData.form.GWAK088},
                loading: true,
                toJsonStr: true,
                okmsg: '退回成功',
                cb: function (result) {
                    if (result.ok) {
                        app.pageModule('gwai300').reloadTableCurr();
                        self._closeTpl();
                    }
                }
            });
        },

        _call: function (obj) {
            callObj = obj;
        },

        _ready: function () {
            var vue = new Vue({
                el: '#gwai300_edit_gwak088',
                data: vueData,
                methods: {
                    cancel: function () {
                        layer.close(layer.index);
                    },
                    sure: function () {
                        this.$refs['form'].validate(function (valid) {
                            if (valid) {
                                self.updateData();
                            }
                        });
                    }
                },
                watch: {},
                created: function () {
                    self._setEleIsReady('gwai300_edit_gwak088');
                }
            });
        },

        _lazy: function () {
            this._super();
        }
    });

    return new Gwak088Edit();

});